﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Effects.Operations
{
    public class RemoveOverlayEffect : Effect
    {

        /// <summary>
        /// Target that will receive the overlay
        /// </summary>
        public Engine.iCanBeOverlayed target;

        /// <summary>
        /// Name of the overlay in the collection
        /// </summary>
        public string name;

        /// <summary>
        /// Creates a new RemoveOverlay effect
        /// </summary>
        /// <param name="target">Target of the overlay</param>
        /// <param name="name">Name of that overlay, must be unique or it will replace an existing overlay</param>
        public RemoveOverlayEffect(Engine.iCanBeOverlayed target, String name)
        {
            this.target = target;
            this.name = name;
        }

        /// <summary>
        /// Applies the effect on the target
        /// </summary>
        public override void apply()
        {
            this.target.removeOverlay(this.name);
        }

    }
}
